<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.entity.*"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>文章修改</title>
		<link rel="styleSheet"
			href="<%=request.getContextPath()%>/background/css/body.css"
			type="text/css" media="all" />
	</head>

	<body>
		<%
			Article article = (Article) request.getAttribute("article");
		%>
		<script language="javascript">
    function validate(form)
    {  
       if(form.user_name.value.length==0){
            alert("文章名不能为空！");
            form.user_name.focus();
            return false;
            }
       if(form.article_name.value.length==0){
            alert("文章名不能为空！");
            form.article_name.focus();
            return false;
            }
    } 
    </script>

		<center>
			<br />
			<br />
			<br />
			<form method="post" action="/myblog/servlet/UpdateArticleServlet"
				onsubmit="return validate(this)">
				<input type="hidden" name="article_id" value="<%=article.getArticle_id() %>">
				<table>
					<caption>
						文章信息
					</caption>
					<tr>
						<td>
							用户名：
						</td>
						<td>
							<input type="text" name="user_name" value="<%=article.getUser_name() %>">
						</td>
					</tr>
					<tr>
						<td>
							文章名：
						</td>
						<td>
							<input type="text" name="article_name"
								value="<%=article.getArticle_name()%>">
						</td>
					</tr>
					<tr>
						<td>
							文章内容：
						</td>

						<td>
							<textarea name="article_content" rows="10" cols="80"> 
							<%=article.getArticle_content()%>
    			</textarea>
						</td>
					</tr>

				</table>
				<input type="submit" name="submit" value="提交" />

				<input type="reset" name="reset" value="重写" />







			</form>
		</center>
	</body>
</html>
